def GSCN2CentFreq(gscn):
    if gscn<7500:
        n = gscn % 3
        if n==0:
            N = gscn // 3
            M = 3
        elif n==1:
            N = gscn // 3
            M = 5
        else:
            N = gscn // 3 + 1
            M = 1
        return N*1.2e6+M*50e3
    elif gscn<22256:
        return (gscn-7499)*1.44e6+3e9
    else:
        return (gscn-22256)*17.28e6+24250.08e9
    
def gscn_pssIndices(carrier,f_ssb,f_center):
    n = int(((f_center-f_ssb)/1e3)/carrier.SubcarrierSpacing)
    return carrier.NSizeGrid*12//2-n-64

    